import request from "@/utils/request";

// 查询演习基础信息
export function pracBaseList(query) {
  return request({
    url: "/practice/pracBase/list",
    method: "get",
    params: query
  });
}

// 删除演习
export function delPractice(id) {
  return request({
    url: "/practice/pracBase/" + id,
    method: "delete"
  });
}

// 演习列表中的状态的显示 - 获取运行模式
export function isPrace() {
  return request({
    url: "/common/config/getByKey/IS_PRAC",
    method: "get"
  });
}

export function pracInfo() {
  return request({
    url: "/common/config/getByKey/PRAC_INFO",
    method: "get"
  });
}

// 启动演习
export function exePractice(id) {
  return request({
    url: "/practice/data/exe",
    method: "get",
    params: id
  });
}

// 重启演习最小时间限制
export function getTimePntMin() {
  return request({
    url: "/practice/data/getTimePntMin",
    method: "get"
    // params: id
  });
}

// 关闭演习
export function stopPractice(id) {
  return request({
    url: "/practice/data/stop",
    method: "get",
    params: id
  });
}

// 复制演习
export function copyInfo(id) {
  return request({
    url: "/practice/pracBase/copyInfo",
    method: "get",
    params: id
  });
}

// 修改演习
export function changePracBase(data) {
  return request({
    url: "/practice/pracBase",
    method: "put",
    data: data
  });
}

// 演习-查看-详情
export function praceBase(id) {
  return request({
    url: "/practice/pracBase/" + id,
    method: "get"
    // params: id
  });
}

// 演习-查看-获取堆芯数据列表
export function facilityList() {
  return request({
    url: "/data/facility/list",
    method: "get"
  });
}

// 演习-查看-获取堆芯数据列表
export function eventList(id) {
  return request({
    url: "/practice/event/listAll",
    method: "get",
    params: id
  });
}

// 演习-查看-参数列表
export function practiceDetailList(id) {
  return request({
    url: "/practice/detail/list",
    method: "get",
    params: id
  });
}

//=================新建================
// 演习基础信息新建
export function createPracBase(data) {
  return request({
    url: "/practice/pracBase",
    method: "post",
    data: data
  });
}

// 新建演习脚本的事件
export function createEvent(data) {
  return request({
    url: "/practice/event",
    method: "post",
    data: data
  });
}

// 修改事件基础信息
export function editEvent(data) {
  return request({
    url: "/practice/event",
    method: "put",
    data: data
  });
}

// 演习参数-获取堆芯参数
export function parameterList(id) {
  return request({
    url: "/data/parameter/list",
    method: "get",
    params: id
  });
}

// 获取演习事件下对应的演戏参数列表
export function eventParamsList(id) {
  return request({
    url: "/practice/detail/list",
    method: "get",
    params: id
  });
}

// 创建参数
export function createParams(data) {
  return request({
    url: "/practice/detail",
    method: "post",
    data: data
  });
}

// 修改-参数
export function editParams(data) {
  return request({
    url: "/practice/detail",
    method: "put",
    data: data
  });
}

// 删除-参数
export function deleteParams(id) {
  return request({
    url: "/practice/detail/" + id,
    method: "delete"
  });
}

// 删除演习-事件
export function deleteEvent(id) {
  return request({
    url: "/practice/event/" + id,
    method: "delete"
  });
}

// 获取全局应急等级
export function getLevel() {
  return request({
    url: "/common/config/getByKey/ES_MODE",
    method: "get"
  });
}
